// 有token正常跳转，无token去登录

import { Navigate } from "react-router-dom";
import { getToken } from "../utils/token";
function AuthToken ({children}) {
   const token = getToken('user_token')
   if(token) {
    return <>{children}</>

   } else {
    return <Navigate to={'/login'} replace></Navigate>
   }
}

export default  AuthToken